/*
 * File:   cSTOCStereo.h
 * Author: lrm
 *
 * Created on September 20, 2010, 6:23 PM
 */

#ifndef _CSTOCSTEREO_H_
#define	_CSTOCSTEREO_H_

#include "svsclass.h"
#include "cSvsOpencv.h"
#include "cViewWindow.h"
#include <wx/wx.h>
#include <highgui.h>
#include <cv.h>
#include <cvaux.h>

using namespace cv;

class cSTOCStereo : public wxThreadHelper, public wxEvtHandler
{
	cViewWindow* leftView, *rightView, *stereoView;

	wxRadioBox* algorithmRadioBox;

	wxBitmap outLeft, outRight, dispBMP;

	IplImage *imgLeft, *imgRight, *imgStereo;

	cSvsOpencv *svsOpencv;

	CvVideoWriter *writer, *writerR, *writerS;
	wxString screenshotName;


	bool started;
	bool fSaveVideo;
	bool fSaveScreenshot;
	bool fCalculateStereo;

	wxCriticalSection dataCS;

	void* Entry();

public:

	cSTOCStereo(wxRadioBox* algorithmRadioBox);
	void startCam(int aResH, int aResV, bool aIsColor, wxString extrinFile, wxString intrinFile);
	void startSaveVideo(wxString vName, bool sLeft, bool sRight, bool sStereo);
	void startCalculateStereo(int numberD, int SADs);
	void stopCalculateStereo();
	void stopSaveVideo();
	void saveScreenshot(wxString ssName);
	void stopCam();
	void OnThreadUpdate(wxCommandEvent& evt);

	~cSTOCStereo();

};



#endif	/* CSTOCSTEREO_H */
